package com.wnxy.sddfp.client.bank.fallback;

import com.wnxy.sddfp.client.bank.TradeLogApi;
import com.wnxy.sddfp.common.model.dto.bank.BankCardAddDTO;
import com.wnxy.sddfp.common.model.dto.bank.SignatureDTO;
import com.wnxy.sddfp.common.model.dto.bid.BankBidDTO;
import com.wnxy.sddfp.common.model.dto.bid.BidBalanceDTO;
import com.wnxy.sddfp.common.model.vo.trade.BorrowSyncRecordVo;
import com.wnxy.sddfp.common.result.Result;
import org.springframework.stereotype.Component;

@Component
public class TradeLogApiFallback implements TradeLogApi {
    // 当远程调用出现异常时候，这里做降级处理
    @Override
    public SignatureDTO proxyBindCardLog(BankCardAddDTO bankCardAddDTO) {
        // 降级业务：返回空
        SignatureDTO signatureDTO = new SignatureDTO();
        signatureDTO.setReqCode("Feign接口-降级处理");
        return signatureDTO;
    }

    @Override
    public Result syncBorrowRecord(BorrowSyncRecordVo borrowSyncRecordVo) {
        return Result.fail("服务降级：同步数据失败！");
    }

    @Override
    public Result<BidBalanceDTO> getBidBalance(String userCode) {
        return Result.fail("服务降级：同步数据失败！");
    }

    @Override
    public Result<String> bankBidService(BankBidDTO bankBidDTO) {
        return Result.fail("服务降级：同步数据失败！");
    }
}
